package com.fuxian.service.impl;

import java.sql.Timestamp;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.fuxian.dao.NewsDao;
import com.fuxian.model.News;
import com.fuxian.service.NewsService;

@Repository
public class NewsServiceImp implements NewsService {
	@Resource
	private NewsDao newsDao;
	private static int size = 10;
	private static int start = 0;

	public void addNews(News news) {
		newsDao.addNews(news);

	}

	public void deleteNewsById(int id) {
		newsDao.deleteNewsById(id);

	}

	public void modifyNews(News news) {
		newsDao.modifyNews(news);

	}

	public List<News> selectAllNews(int start, int size) {
		return newsDao.selectAllNews(start, size);
	}

	public List<News> selectAllNews() {

		return selectAllNews(start, size);
	}

	public List<News> selectNewsByAuthor(String author, int start, int size) {

		return newsDao.selectNewsByAuthor(author, start, size);
	}

	public List<News> selectNewsByAuthor(String author) {

		return selectNewsByAuthor(author, start, size);
	}

	public List<News> selectNewsByCreatetime(Timestamp createTime, int start,
			int size) {

		return newsDao.selectNewsByCreatetime(createTime, start, size);
	}

	public List<News> selectNewsByCreatetime(Timestamp createTime) {
		return selectNewsByCreatetime(createTime, start, size);
	}

	public News selectNewsById(int id) {
		return newsDao.selectNewsById(id);
	}

	public int selectCount() {
		return newsDao.selectCount();
	}
}
